/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package data;

import control.bean.ControlBeanConstant;
import control.bean.ControlPropertiesBean;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;

/**
 *
 * @author Minsk
 */
public class FormTemplateManagerTest {
    public static void main(String[] args) {
        
//        ArrayList<ControlPropertiesBean> cpbTemplate = new ArrayList<ControlPropertiesBean>();
//
//        ControlPropertiesBean cpb = new ControlPropertiesBean();
//        HashMap<String, String> cpbProps = new HashMap<String, String>();
//        cpbProps.put(ControlBeanConstant.CONTROLNAME, "ABC");
//        cpbProps.put(ControlBeanConstant.FIELDTYPE, String.valueOf(ControlBeanConstant.TEXTFIELD));
//        cpbProps.put(ControlBeanConstant.WIDTH, "150");
//        cpbProps.put(ControlBeanConstant.HEIGHT, "100");
//        cpbProps.put(ControlBeanConstant.ROWNUMBER, "1");
//        cpbProps.put(ControlBeanConstant.POSITIONINROW, "1");
//
//        cpbProps.put(ControlBeanConstant.INPUTVALUE, "");
//
//        cpb.setProps(cpbProps);
//
//        cpbTemplate.add(cpb);
//
//        cpb = new ControlPropertiesBean();
//        cpbProps = new HashMap<String, String>();
//        cpbProps.put(ControlBeanConstant.CONTROLNAME, "DEF");
//        cpbProps.put(ControlBeanConstant.FIELDTYPE, String.valueOf(ControlBeanConstant.TEXTFIELD));
//        cpbProps.put(ControlBeanConstant.WIDTH, "250");
//        cpbProps.put(ControlBeanConstant.HEIGHT, "300");
//        cpbProps.put(ControlBeanConstant.ROWNUMBER, "1");
//        cpbProps.put(ControlBeanConstant.POSITIONINROW, "2");
//
//        cpbProps.put(ControlBeanConstant.INPUTVALUE, "THE");
//
//        cpb.setProps(cpbProps);
//
//        cpbTemplate.add(cpb);
//
//        cpb = new ControlPropertiesBean();
//        cpbProps = new HashMap<String, String>();
//        cpbProps.put(ControlBeanConstant.CONTROLNAME, "GHI");
//        cpbProps.put(ControlBeanConstant.FIELDTYPE, String.valueOf(ControlBeanConstant.TEXTFIELD));
//        cpbProps.put(ControlBeanConstant.WIDTH, "150");
//        cpbProps.put(ControlBeanConstant.HEIGHT, "300");
//        cpbProps.put(ControlBeanConstant.ROWNUMBER, "2");
//        cpbProps.put(ControlBeanConstant.POSITIONINROW, "1");
//
//        cpbProps.put(ControlBeanConstant.INPUTVALUE, "W");
//
//        cpb.setProps(cpbProps);
//
//        cpbTemplate.add(cpb);
        FormTemplateManager manager = new FormTemplateManager();
        File file = new File("C:/Users/Deshun/Documents/NetBeansProjects/FormBuilder0.1/abc.xml");
        manager.setFormTemplatePath(file);
//        manager.saveTemplate("", cpbTemplate);
        
        
        ArrayList<ControlPropertiesBean> cpbTemplateLoaded = manager.loadTemplate("");
        System.out.println("Size: " + cpbTemplateLoaded.size());
        for (ControlPropertiesBean cpbL : cpbTemplateLoaded){
            System.out.println(cpbL);
        }
        
    }
}
